package com.example.mp.handler;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

@Component
public class MyMetaObjectHandler  implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        Object password = getFieldValByName("password", metaObject);
        if (password == null) {
            setFieldValByName("password", "8888888", metaObject);
        }
    }

    @Override
    public void updateFill(MetaObject metaObject) {

    }
}
